Skip to content

refactor!: deprecation cycle - #1128

Merged
devcrocod merged 2 commits into
mainfrom
devcrocod/raise-deprecation-levels
Oct 27, 2026
Merged

devcrocod merged 2 commits into
mainfrom
devcrocod/raise-deprecation-levels

Conversation

@devcrocod

Copy link
Copy Markdown
Contributor

Raises the level of APIs deprecated in 0.9.0–0.13.0 and removes the mcpStatelessStreamableHttp overload that has been ERROR since 0.15.0.

ERROR:

  • StreamableHttpServerTransport(), StreamableHttpServerTransport(enableJsonResponse, …)
  • StreamableHttpClientTransport, mcpStreamableHttpTransport, mcpStreamableHttp with reconnectionTime
  • ElicitRequest.requestedSchema, ElicitRequestParams(message, requestedSchema, meta)
  • ClientCapabilities(sampling: JsonObject?, …)
  • Configuration.enableDnsRebindingProtection, allowedHosts, allowedOrigins

HIDDEN: StdioServerTransport(inputStream, outputStream). With ERROR, a positional StdioServerTransport(input, output) would resolve to it and stop compiling.

LegacyTitledEnumSchema stays at WARNING while the spec still lists it.

How Has This Been Tested?

JVM compilation of all modules with tests; ElicitationTest, ElicitationDslTest, StreamableHttpServerTransportTest; README (knit) and samples compile; ktlint, detekt, checkKotlinAbi.

Breaking Changes

  • Code using the ERROR APIs no longer compiles; existing binaries keep working.
  • StdioServerTransport(inputStream = …, outputStream = …): rename the arguments to input and output.
  • mcpStatelessStreamableHttp: binaries built against 0.14.0 or earlier fail with NoSuchMethodError; recompile.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

…ecation levels, standardize parameter naming for consistency (`inputStream` to `input`, `outputStream` to `output`), and remove obsolete APIs.
Copilot AI balanced review requested due to automatic review settings October 19, 2026 19:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The scoped API changes and migrated usages match the documented deprecation plan, with no unresolved blocking findings.

No open issues 🎉

What changed in this PR

Advances the Kotlin SDK’s deprecation cycle and migrates internal usages and examples to supported APIs.

Changes:

  • Raises legacy APIs to ERROR and hides the old stdio constructor.
  • Removes the deprecated stateless HTTP overload and updates API snapshots.
  • Updates examples, DSL construction, and compatibility-test suppression.
File Description
samples/​weather-stdio-server/​src/​main/​kotlin/​io/​modelcontextprotocol/​sample/​server/​McpWeatherServer.kt Uses current stdio argument names.
samples/​kotlin-mcp-server/​src/​main/​kotlin/​io/​modelcontextprotocol/​sample/​server/​server.kt Migrates stdio constructor arguments.
README.md Updates stdio and sampling examples.
kotlin-sdk-server/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​server/​StreamableHttpServerTransport.kt Escalates legacy API deprecations.
kotlin-sdk-server/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​server/​StdioServerTransport.kt Hides the legacy constructor.
kotlin-sdk-server/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​server/​KtorServer.kt Removes the deprecated stateless overload.
kotlin-sdk-server/​api/​kotlin-sdk-server.klib.api Records the removed overload.
kotlin-sdk-server/​api/​kotlin-sdk-server.api Records JVM API changes.
kotlin-sdk-core/​src/​commonTest/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​types/​ElicitationTest.kt Updates compatibility-test suppression.
kotlin-sdk-core/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​types/​elicitation.kt Escalates legacy elicitation deprecations.
kotlin-sdk-core/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​types/​elicitation.dsl.kt Uses the supported form-parameters constructor.
kotlin-sdk-core/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​types/​capabilities.kt Escalates the legacy capabilities constructor deprecation.
kotlin-sdk-client/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​client/​StreamableHttpMcpKtorClientExtensions.kt Escalates legacy reconnection overload deprecations.
kotlin-sdk-client/​src/​commonMain/​kotlin/​io/​modelcontextprotocol/​kotlin/​sdk/​client/​StreamableHttpClientTransport.kt Escalates the legacy transport constructor deprecation.

Review effort: Balanced

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — the deprecation cycle is consistent and everything checks out, happy to approve!


Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=f8e7b782-8ea4-4dfc-b1d8-7b34d38ea1f3

@e5l e5l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copilot AI balanced review requested due to automatic review settings October 27, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The Kotlin SDK deprecation and migration changes have no active review issues.

No open issues 🎉

Review effort: Balanced

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All green on my end — happy to approve, with one non-blocking note inline for you to consider.


Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=527bcd77-4b6f-496e-a26b-be3afc38701a

@Deprecated(
"Use mcpStatelessStreamableHttp without eventStore.",
ReplaceWith("mcpStatelessStreamableHttp(path, enableDnsRebindingProtection, allowedHosts, allowedOrigins, block)"),
DeprecationLevel.ERROR,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: the eventStore overload goes straight from ERROR to deleted, so the JVM method and the klib symbol disappear in a single release. StdioServerTransport(inputStream, outputStream) in this same PR is deliberately parked at HIDDEN for exactly that reason; this one skips that step.

Failure scenario: an app depends on a library compiled against 0.14.0 that calls mcpStatelessStreamableHttp(path, …, eventStore = store, block). The app bumps kotlin-sdk-server to the next release without recompiling that library. Nothing fails at compile time — route registration throws NoSuchMethodError the first time it runs.

Suggested fix: keep the declaration one more release with level = DeprecationLevel.HIDDEN and the body unchanged (it already delegates to the supported overload). That removes it from source resolution while leaving the method and klib symbol in place, then delete it in the release after.

@devcrocod
devcrocod merged commit f8b91ae into main Oct 27, 2026
26 of 44 checks passed
@devcrocod
devcrocod deleted the devcrocod/raise-deprecation-levels branch October 27, 2026 14:21

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All clear on my side — the deprecation cycle looks consistent and everything builds and passes, happy to approve!


Produced by Air Automations. Name: Code review / Run: https://air.jetbrains.cloud/org/05cf1a7f-6ab5-713b-abd3-29d0c8a05e2d/automations/409567ec-d3a7-40ac-ba95-8518ec577ac2?run=5e2435a1-c0ce-4a13-8787-312c7a31ffd2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants